<?php

class wms_finder_expressapapi
{

	var $column_edit = '操作';
	var $column_edit_width = "50";

    
    var $detail_expressapapi_line = "明细";
    public function column_edit($row)
    {
        $finder_id = $_GET['_finder']['finder_id'];

        $expressapapiMdl = app::get('wms')->model('expressapapi');
        $expressapapi_datas= $expressapapiMdl->getList('status', array('id' => $row['id'] ),0,1);
        if($expressapapi_datas[0]['status']=='confirmed')
        {
            return '';
        }else
        {
        return '<a href="index.php?app=wms&ctl=admin_expressapapi&act=editexpressapapi&id=' . $row['id'] . '&finder_id='.$finder_id.'" target="_blank">编辑</a>';
        }
    }

    /*
     * 备货通知单明细
     */
    function detail_expressapapi_line($row)
    {
        $render = app::get('wms')->render();
        $sql="SELECT * from sdb_wms_expressapapi_line where apapi_id=".$row;
        $db=kernel::database();
        $basicMaterialInfo=$db->select($sql);  
        foreach ($basicMaterialInfo as $key => $value) {
            $item[$key]=$value;
            if($value['JSType']==0)
            {
                $item[$key]['JSType']='代收代付';
            }elseif($value['JSType']==1)
            {
                $item[$key]['JSType']='理文支付';
            }
        }
           
        $render->pagedata['res'] = $item;
        return $render->fetch('admin/expressapapi/expressap_line.html');
    }

    /*
     * 备货通知单明细
     */
    // function detail_expressadjust_ax($row){
    //     $render = app::get('wms')->render();
    //     $expressadjust_delis = app::get('wms')->model('expressadjust_delis');
    //     $basicMaterialInfo = $expressadjust_delis->getList('*', array('expressadjust_id' => $row));
    //     $render->pagedata['res'] = $basicMaterialInfo;
    //     return $render->fetch('admin/expressadjust/expressadjust_ax.html');
    // }
}